std::vector<Point> View::bezierCurve(Point p1, Point p2, Point p3, Point p4, int density)
{
	float tInc = 1.0f/(float)density;
	std::vector<Point> points;

	for(float t=0;t<1;t+=tInc)
	{
		float x = pow(1 - t, 3)*p1.x + 3*pow(1 - t, 2)*t*p2.x + 3*(1 - t)*pow(t, 2)*p3.x + pow(t, 3)*p4.x;
		float y = pow(1 - t, 3)*p1.y + 3*pow(1 - t, 2)*t*p2.y + 3*(1 - t)*pow(t, 2)*p3.y + pow(t, 3)*p4.y;

		points.push_back(Point(x, y));
	}

	return points;
}